import { formatGMTDate, toPercent, compareObject } from '../../../../assets/js/util.js'
import advance from './advancedFilter.vue'
import echarts from 'echarts'
export default {
    data() {
        return {
            pickerOptions0: {
              disabledDate(time) {
                return time.getTime() > Date.now() - 8.64e7;
              }
            },
            // 默认参数 和 URL
            SRC: '',
            DP: {
                p: '',
                f: ''
            },
            // title
            title: "用户等级分析",
            xlsxTitle:'',
            /* 的宽*/
            pageWidth: '100%',
            /*第一个table*/
            page1: {
                /*当前页显示数量*/
                pageSize: 10,
                /*每页显示的数量*/
                pageSizes: [10, 20, 50, 100],
                /*dataTotal表数量*/
                dataTotal: 0,
                /*分页器*/
                currentPage: 1,
            },
            page2: {
                /*当前页显示数量*/
                pageSize: 10,
                /*每页显示的数量*/
                pageSizes: [10, 20, 50, 100],
                /*dataTotal表数量*/
                dataTotal: 0,
                /*分页器*/
                currentPage: 1,
            },
            page3: {
                /*当前页显示数量*/
                pageSize: 10,
                /*每页显示的数量*/
                pageSizes: [10, 20, 50, 100],
                /*dataTotal表数量*/
                dataTotal: 0,
                /*分页器*/
                currentPage: 1,
            },
            page4: {
                /*当前页显示数量*/
                pageSize: 10,
                /*每页显示的数量*/
                pageSizes: [10, 20, 50, 100],
                /*dataTotal表数量*/
                dataTotal: 0,
                /*分页器*/
                currentPage: 1,
            },
            page5: {
                /*当前页显示数量*/
                pageSize: 10,
                /*每页显示的数量*/
                pageSizes: [10, 20, 50, 100],
                /*dataTotal表数量*/
                dataTotal: 0,
                /*分页器*/
                currentPage: 1,
            },
            // 选择的时间
            date: '',
            dstart: '',
            dend: '',
            // 渠道数组
            plats: [],
            // 渠道数组
            channels: [],
            // 服务器数组
            servers: [],
            postObj2: {
                dstart: '',
                dend: '',
                platform: '0',
                channel: '0',
                server: '0'
            },
            postObj: {
                dsearch: '',
                platform: '0',
                channel: '0',
                server: '0'
            },
            // 新增帐号等级分布对比
            tableHeaderAll1: [{
                prop: 'day',
                label: '日期',
                width: 'auto'
            }, {
                prop: 'platformId',
                label: '平台',
                width: 'auto'
            }, {
                prop: 'channelId',
                label: '渠道',
                width: 'auto'
            }, {
                prop: 'serverId',
                label: '区服',
                width: 'auto'
            }, {
                prop: 'level',
                label: '等级',
                width: 'auto'
            }, {
                prop: 'levelPercent',
                label: '等级人数占比',
                width: 'auto'
            }],
            tableData1: [],
            tableDataAll1: [],

            // 活跃帐号等级对比
            tableHeaderAll2: [{
                prop: 'day',
                label: '日期',
                width: 'auto'
            }, {
                prop: 'platformId',
                label: '平台',
                width: 'auto'
            }, {
                prop: 'channelId',
                label: '渠道',
                width: 'auto'
            }, {
                prop: 'serverId',
                label: '区服',
                width: 'auto'
            }, {
                prop: 'level',
                label: '等级',
                width: 'auto'
            }, {
                prop: 'levelPercent',
                label: '等级人数占比',
                width: 'auto'
            }],
            tableData2: [],
            tableDataAll2: [],

            // 新增帐号等级分布累计
            tableHeaderAll3: [{
                prop: 'day',
                label: '日期',
                width: 'auto'
            }, {
                prop: 'platformId',
                label: '平台',
                width: 'auto'
            }, {
                prop: 'channelId',
                label: '渠道',
                width: 'auto'
            }, {
                prop: 'serverId',
                label: '区服',
                width: 'auto'
            }, {
                prop: 'level_name',
                label: '等级',
                width: 'auto'
            }, {
                prop: 'levelPercent',
                label: '等级人数占比',
                width: 'auto'
            }],
            tableDat3: [],
            tableDataAll3: [],

            // 账号次日流失等级分布
            tableHeaderAll4: [{
                prop: 'day',
                label: '日期',
                width: 'auto'
            }, {
                prop: 'platformId',
                label: '平台',
                width: 'auto'
            }, {
                prop: 'channelId',
                label: '渠道',
                width: 'auto'
            }, {
                prop: 'serverId',
                label: '区服',
                width: 'auto'
            }, {
                prop: 'level',
                label: '等级',
                width: 'auto'
            }, {
                prop: 'levelPercent',
                label: '等级人数占比',
                width: 'auto'
            }],
            tableData4: [],
            tableDataAll4: [],

            // 账号次日流失等级分布
            tableHeaderAll5: [{
                prop: 'day',
                label: '日期',
                width: 'auto'
            }, {
                prop: 'platformId',
                label: '平台',
                width: 'auto'
            }, {
                prop: 'channelId',
                label: '渠道',
                width: 'auto'
            }, {
                prop: 'serverId',
                label: '区服',
                width: 'auto'
            }, {
                prop: 'level',
                label: '等级',
                width: 'auto'
            }, {
                prop: 'levelPercent',
                label: '等级人数占比',
                width: 'auto'
            }],
            tableData5: [],
            tableDataAll5: [],
            // 图表数据
            real: {
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    top: '10px',
                    data: []
                },
                grid: {
                    left: '1%',
                    right: '2%',
                    bottom: '15%',
                    containLabel: true
                },
                toolbox: {
                    right: '20',
                    feature: {
                        dataZoom: {
                            yAxisIndex: 'none'
                        },
                        magicType: {
                            type: ['line', 'bar']
                        },
                        restore: {},
                        saveAsImage: {}
                    }
                },
                xAxis: {
                    type: 'category',
                    data: [],
                    axisLabel: {
                        margin: 20,
                    },
                },
                yAxis: [{
                    type: 'value',
                    // max: 10000
                    axisLabel: {
                        show: true,
                        interval: 'auto',
                        formatter: function(val) {
                            val = toPercent(val);
                            return val
                        }
                    }
                }],
                dataZoom: [{
                    handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
                    handleSize: '80%',
                    handleStyle: {
                        color: '#fff',
                        shadowBlur: 3,
                        shadowColor: 'rgba(0, 0, 0, 0.6)',
                        shadowOffsetX: 2,
                        shadowOffsetY: 2
                    }
                }],
                series: [{
                    name: '1',
                    type: 'line',
                    data: [],
                    symbol: 'triangle',
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#66cf97' },
                                    { offset: 0.5, color: '#4eb59a' },
                                    { offset: 1, color: '#349b98' }
                                ]
                            )
                        },
                        emphasis: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#4eb59a' },
                                    { offset: 0.7, color: '#349b98' },
                                    { offset: 1, color: '#66cf97' }
                                ]
                            )
                        }
                    },
                }, {
                    name: '2',
                    type: 'line',
                    symbol: 'roundRect',
                    data: [],
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#84ebd8' },
                                    { offset: 0.5, color: '#7fd2e2' },
                                    { offset: 1, color: '#7abde8' }
                                ]
                            )
                        },
                        emphasis: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#7abde8' },
                                    { offset: 0.7, color: '#7fd2e2' },
                                    { offset: 1, color: '#84ebd8' }
                                ]
                            )
                        }
                    },
                }, {
                    name: '3',
                    type: 'line',
                    // symbol:'circle',
                    data: [],
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#b8cff1' },
                                    { offset: 0.5, color: '#a99ce4' },
                                    { offset: 1, color: '#a07cdc' }
                                ]
                            )
                        },
                        emphasis: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#a07cdc' },
                                    { offset: 0.7, color: '#a99ce4' },
                                    { offset: 1, color: '#b8cff1' }
                                ]
                            )
                        }
                    },
                }, {
                    name: '4',
                    type: 'bar',
                    data: [],
                }, {
                    name: '5',
                    type: 'bar',
                    data: [],
                }, {
                    name: '6',
                    type: 'bar',
                    data: [],
                }, {
                    name: '7',
                    type: 'bar',
                    data: [],
                }, {
                    name: '8',
                    type: 'bar',
                    data: [],
                }]
            },
            // 选择菜单
            selectedType: "1",
        }
    },
    methods: {
        //初始化
        // 设置图表初始化宽度
        chartsWidth(el) {
            if (document.getElementById(el) !== null) {
                document.getElementById(el).style.width = window.innerWidth - 272 + "px";
            }
        },
        _init() {
            var arr = ['realTimeData', 'realTimeData2', 'realTimeData3', 'realTimeData4', 'realTimeData5'];
            for (var x = 0; x < arr.length; x++) {
                this.chartsWidth(arr[x]);
                this[arr[x] + 'Chart'] = echarts.init(document.getElementById(arr[x]));
                this[arr[x] + 'Chart'].setOption(this.real);
            }
            window.addEventListener('resize', function() {
                for (var i in arr) {
                    this.chartsWidth(arr[i])
                }
                var resizeArr = ['realTimeDataChart', 'realTimeData2Chart', 'realTimeData3Chart', 'realTimeData4Chart', 'realTimeData5Chart']
                for (var j in resizeArr) {
                    this[resizeArr[j]].resize();
                }
            }.bind(this))
        },
        // 表格下载
        excel(tableIndex, sheet) {
           this.xlsxTitle = sheet+"-"+this.postObj.dsearch;
           this.downloadExl(this["tableHeaderAll" + tableIndex], this["tableDataAll" + tableIndex],this.xlsxTitle, sheet);
        },
        // 通用 成功 与 失败
        successFun(data) {
            this.$message({
                message: data,
                type: 'success'
            });
        },
        errorFun(data) {
            this.$message.error(data);
        },
        // 时间改变 得到起始时间和结束时间
        dateChange(val) {
            if (val === undefined) {
                this.errorFun('请选择查看时间！')
            } else {
                this.postObj.dsearch = val;
                if (this.tableDataAll1.length !== 0) {
                    console.log(1)
                    this.getData(this.postObj);
                }
            }
        },
        dstartChange(val) {
            if (val === undefined) {
                this.errorFun('请选择查看时间！')
            } else {
                this.postObj2.dstart = val;
                if (this.tableDataAll1.length !== 0) {
                    this.getData2(this.postObj2);
                }
            }
        },
        dendChange(val) {
            if (val === undefined) {
                this.errorFun('请选择查看时间！')
            } else {
                this.postObj2.dend = val;
                if (this.tableDataAll1.length !== 0) {
                    this.getData2(this.postObj2);
                }
            }
        },
        // 分页器
        // // 控制每页的数量
        handleSizeChange1(val) {
            this.page1.pageSize = val;
            this.tableControl1();
        },
        // 页数
        handleCurrentChange1(val) {
            this.page1.currentPage = val;
            this.tableControl1();
        },
        tableControl1() {
            this.tableData1 = this.tableDataAll1.slice((this.page1.currentPage - 1) * this.page1.pageSize, this.page1.currentPage * this.page1.pageSize)
        },
        // 控制每页的数量
        handleSizeChange2(val) {
            this.page2.pageSize = val;
            this.tableControl2();
        },
        // 页数
        handleCurrentChange2(val) {
            this.page2.currentPage = val;
            this.tableControl2();
        },
        tableControl2() {
            this.tableData2 = this.tableDataAll2.slice((this.page2.currentPage - 1) * this.page2.pageSize, this.page2.currentPage * this.page2.pageSize)
        },
        // 控制每页的数量
        handleSizeChange3(val) {
            this.page3.pageSize = val;
            this.tableControl3();
        },
        // 页数
        handleCurrentChange3(val) {
            this.page3.currentPage = val;
            this.tableControl3();
        },
        tableControl3() {
            this.tableData3 = this.tableDataAll3.slice((this.page3.currentPage - 1) * this.page3.pageSize, this.page3.currentPage * this.page3.pageSize)
        },
        // 控制每页的数量
        handleSizeChange4(val) {
            this.page4.pageSize = val;
            this.tableControl4();
        },
        // 页数
        handleCurrentChange4(val) {
            this.page4.currentPage = val;
            this.tableControl4();
        },
        tableControl4() {
            this.tableData4 = this.tableDataAll4.slice((this.page4.currentPage - 1) * this.page4.pageSize, this.page4.currentPage * this.page4.pageSize)
        },
        // 控制每页的数量
        handleSizeChange5(val) {
            this.page5.pageSize = val;
            this.tableControl5();
        },
        // 页数
        handleCurrentChange5(val) {
            this.page5.currentPage = val;
            this.tableControl5();
        },
        tableControl5() {
            this.tableData5 = this.tableDataAll5.slice((this.page5.currentPage - 1) * this.page5.pageSize, this.page5.currentPage * this.page5.pageSize)
        },
        // 变成分数
        pencent(data) {
            //转换为%比 
            for (var i = 0; i < data.length; i++) {
                for (var j in data[i]) {
                    if (j === 'levelPercent') {
                        data[i][j] = toPercent(data[i][j]);
                    }
                }
            }
            return data
        },
        tableControl() {
            this.tableData = this.tableDataAll.slice((this.currentPage - 1) * this.pageSize, this.currentPage * this.pageSize)
        },
        // 选择游戏的平台
        handleSelect(key, keyPath) {
            if (key === '4') {
                this.$refs.advance.filterShow = true;
                return
            }
            if (this.postObj['server'] === '0' && this.postObj['channel'] === '0') {
                this.postObj['server'] = '0';
                this.postObj['channel'] = '0';
                this.postObj['platform'] = key;
                this.getList("updatePlatform", `platform=${key}`);
                this.getData(this.postObj);
            } else {
                if (key === "3" || key === "2" || key === "9") {
                    this.errorFun("请修改为全渠道和全服！")
                }
            }
        },
        //在线趋势 菜单变换  
        handle(key, keyPath) {
            this.selectedType = key;
            this.getData(this.postObj);
        },
        // 获取服务器list 平台list  服务器list
        getList(url, choose) {
            var that = this;
            var pushData = function(pushArr, attr, data) {
                that[pushArr] = [];
                for (var i in data[attr]) {
                    that[pushArr].push({
                        value: i,
                        label: data[attr][i]
                    })
                }
            };
            this.$http.jsonp(`${that.SRC}data/get.do?p=${that.DP.p}&f=${that.DP.f}&a=${url}`, {
                params: { 'ps': choose }
            }).then(function(res) {
                var data = JSON.parse(JSON.parse(res.body));
                if (parseInt(data["res"]) === 0) {
                    // 后台select的数据
                    var lists = ["platformItmes", "channelItmes", "serverItmes"];
                    // 页面select名字
                    var nameLists = ["plats", "channels", "servers"];
                    for (var i = 0; i < lists.length; i++) {
                        if (data[lists[i]] !== undefined) {
                            pushData(nameLists[i], lists[i], data);
                        }
                    }
                } else {
                    this.getErrorMsg(Number(data.res))
                }
            })
        },
        // 获取数据
        getData(data) {
            var that = this;
            var p = new Promise(function(resolve, reject) {
                that.dataTotal = 0;
                that.loading = true;
                that.$http.jsonp(`${that.SRC}data/get.do?p=${that.DP.p}&f=${that.DP.f}&a=search`, {
                    params: { 'ps': `dsearch=${data.dsearch}&platform=${data.platform}&channel=${data.channel}&server=${data.server}` }
                }).then(function(res) {
                    resolve(res.body)
                })
            })
            p.then(function(value) {
                that.loading = false;
                var data = JSON.parse(value)
                var d = JSON.parse(data.replace(/\"\{\"/g, '\{\"').replace(/\"\}\"/g, '\"\}'));
                if (parseInt(d["res"]) === 0) {
                    that.page1.dataTotal = d.dataList100.length;
                    that.tableDataAll1 = that.pencent(d.dataList100);
                    that.tableControl1();
                    that.page2.dataTotal = d.dataList1.length;
                    that.tableDataAll2 = that.pencent(d.dataList1);
                    that.tableControl2();
                    that.page3.dataTotal = d.dataList2.length;
                    that.tableDataAll3 = that.pencent(d.dataList2);
                    that.tableControl3();
                    that.echartsData(d);
                } else {
                    that.errorFun(data["msg"])
                }
            })
        },
        getData2(data) {
            console.log(data)
            var that = this;
            var p = new Promise(function(resolve, reject) {
                that.dataTotal = 0;
                that.loading = true;
                that.$http.jsonp(`${that.SRC}data/get.do?p=${that.DP.p}&f=${that.DP.f}&a=search2`, {
                    params: { 'ps': `dstart=${data.dstart}&dend=${data.dend}&platform=${data.platform}&channel=${data.channel}&server=${data.server}` }
                }).then(function(res) {
                    resolve(res.body)
                })
            })
            p.then(function(value) {
                that.loading = false;
                var data = JSON.parse(value)
                var d = JSON.parse(data.replace(/\"\{\"/g, '\{\"').replace(/\"\}\"/g, '\"\}'));
                if (parseInt(d["res"]) === 0) {
                    that.page4.dataTotal = d.dataList3.length;
                    that.tableDataAll4 = that.pencent(d.dataList3);
                    that.tableControl4();
                    that.page5.dataTotal = d.dataList4.length;
                    that.tableDataAll5 = that.pencent(d.dataList4);
                    that.tableControl5();
                    that.echartsData2(d)
                } else {
                    that.errorFun(data["msg"])
                }
            })
        },
        // 改变表数据
        echartsData(d) {
            this.realLoadShow = false;
            if (d.chartData100 === undefined) {
                var data = {
                    "columnkeys": [],
                    "names": [],
                    "data": [
                        []
                    ]
                }
            } else {
                var data = d['chartData100']['jsonStr'];
            }
            this.realTimeDataChart.setOption({
                legend: {
                    data: data['names']
                },
                xAxis: {
                    data: data.columnkeys
                },
                series: [{
                        name: data.names[0],
                        data: data.data[0],
                        smooth: true,
                    },
                    {
                        name: data.names[1],
                        data: data.data[1],
                        smooth: true,
                    },
                    {
                        name: data.names[2],
                        data: data.data[2],
                        smooth: true,
                    }
                ]
            });
            if (d.chartData1 === undefined) {
                var data = {
                    "columnkeys": [],
                    "names": [],
                    "data": [
                        []
                    ]
                }
            } else {
                var data = d['chartData1']['jsonStr'];
            }
            this.realTimeData2Chart.setOption({
                legend: {
                    data: data['names']
                },
                xAxis: {
                    data: data.columnkeys
                },
                series: [{
                    name: data.names[0],
                    data: data.data[0],
                    smooth: true,
                }]
            });
            if (d.chartData2 === undefined) {
                var data = {
                    "columnkeys": [],
                    "names": [],
                    "data": [
                        []
                    ]
                }
            } else {
                var data = d['chartData2']['jsonStr'];
            }
            this.realTimeData3Chart.setOption({
                legend: {
                    data: data['names']
                },
                xAxis: {
                    data: data.columnkeys
                },
                series: [{
                        type: 'bar',
                        name: data.names[0],
                        data: data.data[0],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[1],
                        data: data.data[1],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[2],
                        data: data.data[2],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[3],
                        data: data.data[3],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[4],
                        data: data.data[4],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[5],
                        data: data.data[5],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[6],
                        data: data.data[6],
                        smooth: true,
                    },
                    {
                        type: 'bar',
                        name: data.names[7],
                        data: data.data[7],
                        smooth: true,
                    }
                ]
            });
        },
        // 改变表数据
        echartsData2(d) {
            this.realLoadShow = false;
            if (d.chartData3 === undefined) {
                var data = {
                    "columnkeys": [],
                    "names": [],
                    "data": [
                        []
                    ]
                }
            } else {
                var data = d['chartData3']['jsonStr'];
            }
            this.realTimeData4Chart.setOption({
                legend: {
                    data: data['names']
                },
                xAxis: {
                    data: data.columnkeys
                },
                series: [{
                    name: data.names[0],
                    data: data.data[0],
                    smooth: true,
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#84ebd8' },
                                    { offset: 0.5, color: '#7fd2e2' },
                                    { offset: 1, color: '#7abde8' }
                                ]
                            )
                        },
                        emphasis: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#7abde8' },
                                    { offset: 0.7, color: '#7fd2e2' },
                                    { offset: 1, color: '#84ebd8' }
                                ]
                            )
                        }
                    },
                }]
            });
            if (d.chartData4 === undefined) {
                var data = {
                    "columnkeys": [],
                    "names": [],
                    "data": [
                        []
                    ]
                }
            } else {
                var data = d['chartData4']['jsonStr'];
            }
            this.realTimeData5Chart.setOption({
                legend: {
                    data: data['names']
                },
                xAxis: {
                    data: data.columnkeys
                },
                series: [{
                    name: data.names[0],
                    data: data.data[0],
                    smooth: true,
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#b8cff1' },
                                    { offset: 0.5, color: '#a99ce4' },
                                    { offset: 1, color: '#a07cdc' }
                                ]
                            )
                        },
                        emphasis: {
                            color: new echarts.graphic.LinearGradient(
                                0, 0, 0, 1, [
                                    { offset: 0, color: '#a07cdc' },
                                    { offset: 0.7, color: '#a99ce4' },
                                    { offset: 1, color: '#b8cff1' }
                                ]
                            )
                        }
                    },
                }]
            });
        },
        // 表格排序
        sortChange(column) {
            if (column.prop === null) {
                return;
            } else if (column.order === 'descending') {
                this.tableDataAll1.sort(compareObject(column.prop, false));
            } else { //正序
                this.tableDataAll1.sort(compareObject(column.prop, true));
            }
            this.tableControl1();
        },
        // 表格排序
        sortChange2(column) {
            if (column.prop === null) {
                return;
            } else if (column.order === 'descending') {
                this.tableDataAll2.sort(compareObject(column.prop, false));
            } else { //正序
                this.tableDataAll2.sort(compareObject(column.prop, true));
            }
            this.tableControl2();
        },
        // 表格排序
        sortChange3(column) {
            if (column.prop === null) {
                return;
            } else if (column.order === 'descending') {
                this.tableDataAll3.sort(compareObject(column.prop, false));
            } else { //正序
                this.tableDataAll3.sort(compareObject(column.prop, true));
            }
            this.tableControl3();
        },
        // 表格排序
        sortChange4(column) {
            if (column.prop === null) {
                return;
            } else if (column.order === 'descending') {
                this.tableDataAll4.sort(compareObject(column.prop, false));
            } else { //正序
                this.tableDataAll4.sort(compareObject(column.prop, true));
            }
            this.tableControl4();
        },
        // 表格排序
        sortChange5(column) {
            if (column.prop === null) {
                return;
            } else if (column.order === 'descending') {
                this.tableDataAll5.sort(compareObject(column.prop, false));
            } else { //正序
                this.tableDataAll5.sort(compareObject(column.prop, true));
            }
            this.tableControl5();
        },
    },
    components: {
        'v-advance': advance
    },
    computed: {
        // xlsx() {
        //     return this.title + '.xlsx'
        // }
    },
    mounted() {

        this._init();
        // 初始化URL
        this.SRC = this.$store.getters.src;
        this.DP.p = localStorage.getItem('ZULONGBIPROJECTID');
        this.DP.f = localStorage.getItem('ZULONGBIPAGEID');
        this.date = new Date(new Date().getTime() - 1 * 86400000);
        this.postObj.dsearch = formatGMTDate(new Date() - 86400000 * 1, true);
        this.dstart = new Date(new Date().getTime() - 7 * 86400000);
        this.dend = new Date(new Date().getTime() - 1 * 86400000);
        this.postObj2.dstart = formatGMTDate(new Date() - 86400000 * 7, true);
        this.postObj2.dend = formatGMTDate(new Date() - 86400000 * 1, true);
        // 获取到服务器 平台 渠道 list
        this.getList("initParam", "");

        // 请求数据
        this.getData(this.postObj);
        this.getData2(this.postObj2);
    }
}